<?php
/**
 * ///Sky:第一个model
 * 关于管理地址的model类
 */

class ModelCatalogKeeplace extends Model {
	/**
	 * 根据id得到物品管理地点
	 * @param int $keeplace_id 位置id
	 */
	public function getKeeplace($keeplace_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "keeplace WHERE keeplace_id = '" . (int)$keeplace_id . "'");
	
		return $query->row;
	}
	
	public function getKeeplaces(){
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "keeplace");
		
		return $query->rows;
	}
	/*
	public function getInformations() {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC");
		
		return $query->rows;
	}
	
	public function getInformationLayoutId($information_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information_to_layout WHERE information_id = '" . (int)$information_id . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "'");
		 
		if ($query->num_rows) {
			return $query->row['layout_id'];
		} else {
			return $this->config->get('config_layout_information');
		}
	}
	*/	
}
?>